import request from '@/api/request';

/**
 * 分页
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const serverApiPageApi = query => {
    return request({
        url: '/api/mgt/serverApi/page',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 通过服务主键查询
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const serverApiListByServerIdApi = query => {
    return request({
        url: '/api/mgt/serverApi/listByServerId',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 详情
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const serverApiDetailApi = query => {
    return request({
        url: '/api/mgt/serverApi/getDetail',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 添加
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const serverApiSaveApi = query => {
    return request({
        url: '/api/mgt/serverApi/save',
        method: 'post',
        data: query,
        isLoading: true
    });
};

/**
 * 编辑
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const serverApiEditApi = query => {
    return request({
        url: '/api/mgt/serverApi/edit',
        method: 'put',
        data: query,
        isLoading: true
    });
};

/**
 * 编辑是否隐藏
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const serverApiEditHideFlagApi = query => {
    return request({
        url: '/api/mgt/serverApi/editHideFlag',
        method: 'put',
        params: query,
        isLoading: true
    });
};

/**
 * 删除
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const serverApiRemoveApi = query => {
    return request({
        url: '/api/mgt/serverApi/removeByIds',
        method: 'delete',
        params: query,
        isLoading: true
    });
};
